var GownFullXMLHTTP = Base.extend({
	A: null,

	url: null,
	method: null,
	async: null,
	data: null,

	fun: null,
	update_id: null,
	dlscript: false,
	constructor: function(method,url,async)
	{
		var x = this;

		this.method = method;
		this.url = url;
		this.async = async;

		A = this.create_xmlhttp();
		if(!A) return;
		this.A = A;
		A.open(method,url,async);
		A.onreadystatechange = function() { x.onReadyStateChange(); };
	},
	start: function()
	{
		this.A.send(this.data);
	},
	onReadyStateChange: function()
	{
		if(this.A.readyState == 4) {
			if(this.dlscript) lib.RunScript(this.A.responseText);
				if(this.fun) this.fun();
			if(this.update_id) {
				var obj = document.getElementById(this.update_id);
				if(obj) obj.innerHTML = this.A.responseText;
			}
		}
	},
	create_xmlhttp: function()
	{
		try{return new ActiveXObject("Msxml2.XMLHTTP5.0");} catch(e){}
		try{return new ActiveXObject("Msxml2.XMLHTTP4.0");} catch(e){}
		try{return new ActiveXObject("Msxml2.XMLHTTP3.0");} catch(e){}
		try{return new ActiveXObject("Msxml2.XMLHTTP2.0");} catch(e){}
		try{return new ActiveXObject("Msxml2.XMLHTTP");} catch(e){}
		try{return new ActiveXObject("Microsoft.XMLHTTP");} catch(e){}
		try{return new XMLHttpRequest();} catch(e){}
		return null;
	}
});
